#pragma once

class Mutex
{
public:
	Mutex();
	~Mutex();

	void Lock();
	void Unlock();
	
	void AssertHeld();

private:
	struct Internal;
	Internal* mInternal;
};

class MutexLock
{
public:
	explicit MutexLock(Mutex& mutex) : mMutex(mutex) { mMutex.Lock(); }
	~MutexLock() { mMutex.Unlock(); }

private:
	MutexLock(const MutexLock&);
	void operator=(const MutexLock&);

	Mutex& mMutex;
};

typedef MutexLock ScopedLock;
